<div style="width: 500px;margin: 0 auto">
    <form name="myForm" novalidate>
        <div style="width: 426px;margin: 0 auto">
            <!--autocomplete="off" 去掉输入框提示-->
            <input type="text" name="name" ng-model="name"  maxlength="4" required autocomplete="off">
            <span style="color:red;float: right;position: relative;right: 180px" ng-show="myForm.name.$error.required && myForm.name.$dirty" >请输入姓名</span>
        </div>
        <div style="width: 426px;margin:  0 auto">
            <input type="radio" name="sex" ng-model="sexa" value="0" required style="position: relative" ng-init="sexa='0'" >男
            <span style="position: relative;left: 80px"><input type="radio" name="sex" ng-model="sexa" value="1" required>女</span>
            <span style="color: red;float: right;position: relative;right: 180px" ng-show="myForm.sex.$error.required">请选择性别</span>
        </div>
        <div style="width: 426px;margin: 0 auto">
            <input type="text" name="age" ng-model="age" maxlength="2" ng-pattern="/^[1-9][0-9]{0,9}$/" required autocomplete="off">
            <span style="color:red" ng-show="myForm.age.$error.required && myForm.age.$dirty">请输入年龄</span>
            <!--myForm.age.$error.pattern不符合正则的时候为true，age<18时为true 只要俩个中有一个满足就显示-->
            <span style="color: red" ng-show="myForm.age.$error.pattern || age<18 ">请输入18-99的正整数</span>
        </div>
        <div style="width: 426px;margin: 0 auto">
           <input type="text" name="sfzh" ng-model="sfzh" ng-minlength="18" maxlength="18"
                       ng-pattern="/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}[\d|x|X]$/" required autocomplete="off">
            <span  style="color:red" ng-show="myForm.sfzh.$error.required && myForm.sfzh.$dirty">请输入身份证号</span>
            <span  style="color:red" ng-show="myForm.sfzh.$error.pattern">请输入正确格式的身份证号</span>
        </div>
        <div style="width: 426px ;margin: 0 auto">
            班级
            <select ng-model="Class1" ng-init="Class1='1'">
                <option ng-repeat="x in Class" value="{{x.id}}" ng-bind="x.banji"></option>
            </select>
            年级
            <select ng-model="grade1" ng-init="grade1='1'">
                <option ng-repeat="x in grade " value="{{x.id}}" ng-bind="x.nianji"></option>
            </select>
            班主任
            <select ng-model="teacher1" ng-init="teacher1='1'">
                <option ng-repeat="x in teacher" value="{{x.id}}" ng-bind="x.t_name"></option>
            </select>
        </div>
        <div style="width: 44px;position: relative;left: 57px" >
            <button ng-click="updata()" ng-disabled="myForm.name.$error.required || myForm.sfzh.$error.required || myForm.sfzh.$error.pattern || age<18 || myForm.age.$error.required || myForm.sex.$error.required">提交</button>
        </div>
    </form>
</div>
